{{!-- 异常处理 --}}
{{#if logicNodeModel.exceptionLinkModel}}
try {
    {{>getRawSQLCall logicNodeModel = logicNodeModel}}
}
catch (Exception e) {
    {{camelCase exceptionLinkModel.dstPSDELogicNode.codeName}}()
}
{{else}}
    {{>getRawSQLoopCall logicNodeModel = logicNodeModel}}
{{/if}}
{{!-- 主逻辑 --}}
{{#*inline "getRawSQLoopCall"}}
Map param = new HashMap();
{{#if logicNodeModel.pSDELogicNodeParams}}
    {{#each logicNodeModel.pSDELogicNodeParams as |nodeParam|}}
        {{#if (eq nodeParam.srcValueType "SRCDLPARAM")}}
param.put("param{{@index}}",_{{lowerCase nodeParam.srcPSDELogicParam.codeName}}.get("{{lowerCase nodeParam.srcFieldName}}"));
        {{else if (eq nodeParam.srcValueType "WEBCONTEXT")}}
param.put("param{{@index}}",_default.get("{{lowerCase nodeParam.srcFieldName}}"));
        {{else if (eq nodeParam.srcValueType "APPDATA")}}
//暂未支持应用数据
        {{else if (eq nodeParam.srcValueType "APPLICATION")}}
//暂未支持应用数据
        {{else if (eq nodeParam.srcValueType "SESSION")}}
param.put("param{{@index}}",_srfuser.getSessionParams().get("{{lowerCase nodeParam.srcFieldName}}"));
        {{else if (eq nodeParam.srcValueType "DATACONTEXT")}}
param.put("param{{@index}}",_default.get("{{lowerCase nodeParam.srcFieldName}}"));
        {{else if (eq nodeParam.srcValueType "ENVPARAM")}}
//暂未支持环境参数
        {{else if (eq nodeParam.srcValueType "VIEWPARAM")}}
//暂未支持视图参数
        {{else if (eq nodeParam.srcValueType "NONE")}}
param.put("param{{@index}}", null);
        {{else if (eq nodeParam.srcValueType "NULLVALUE")}}
param.put("param{{@index}}", null);
        {{else if (eq nodeParam.srcValueType "SRCVALUE")}}
param.put("param{{@index}}", "{{lowerCase nodeParam.srcValue}}"));
        {{/if}}
    {{/each}}
{{/if}}
String strSql = "{{logicNodeModel.rawSql}}";
if(!ObjectUtils.isEmpty(entities){
	for(JSONObject entity : entities){
		{{packageName}}.core.{{lowerCase logicNodeModel.dstPSDataEntity.pSSystemModule.codeName}}.domain.{{pascalCase logicNodeModel.dstPSDataEntity.codeName}} targetEntity = new {{packageName}}.core.{{lowerCase logicNodeModel.dstPSDataEntity.pSSystemModule.codeName}}.domain.{{pascalCase logicNodeModel.dstPSDataEntity.codeName}}();
		for (Map.Entry<String, Object> entry : entity.entrySet()) {
			targetEntity.set(entry.getKey(), entry.getValue());
		}
		_{{lowerCase logicNodeModel.dstPSDataEntity.codeName}}service.{{camelCase logicNodeModel.dstPSDEAction.codeName}}(targetEntity);
	}
}
{{/inline}}